package org.example.entity;

import java.sql.ResultSet;
import java.sql.SQLException;

public class User {
    String userName;
    String password;

    public User() {
    }

    public User(String userName, String password) {
        this.userName = userName;
        this.password = password;
    }

    public String getUserName() {
        return userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public static User map(ResultSet rs) throws SQLException {
        User user = new User();
        user.userName = rs.getString("user_name");
        user.setPassword(rs.getString("password"));
        return user;
    }

    @Override
    public String toString() {
        return "User{" +
                "userName='" + userName + '\'' +
                ", password='" + password + '\'' +
                '}';
    }
}
